forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Quake porting issues
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Sat Jun 25, 2005 6:08 am    Post subject: Quake porting issues Reply with quote

Howdy everyone.

I'm porting PocketQuake for the psp, and I'm running into some issues. I'm using the latest version of oopo's psp tool chain build script, and I can't seem to get a lot of math functions to link correctly. Everything compiles fine, but the psp-ld linker complains about not finding a lot of __dfs symbols. I did a search in the libraries, and it looks like what I need is in libiberty.a, I've included it, but everythting is still blowing up.

Basically, it seems I can't use floating point math functions, or anything that does a floating point conversion, Integer math seems to work fine.
Is there a library I'm missing somehow? Or a compiler flag to enable floating point math?
any help would be appreciated.

-PMF
Back to top
View user's profile Send private message Send e-mail
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jun 25, 2005 6:42 am    Post subject: Reply with quote

#1 reason is you're using psp-ld to link your executable. Use psp-gcc instead. psp-gcc will automatically include libgcc.a which has the floating point library glue that psp-ld is complaining about.
Back to top
View user's profile Send private message
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Sat Jun 25, 2005 7:01 am    Post subject: Thanks Reply with quote

I just figured that out by manually including libgcc.a, it works now. Now I just have to do some major debugging....

-l8r
Back to top
View user's profile Send private message Send e-mail
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Sun Jun 26, 2005 8:10 am    Post subject: Another quake porting question Reply with quote

OK, I've made some progress, Everything colpiles and links fine, now I'm trying to debug this thing to get it to work properly.
Does anyone have any hints / tips for debugging? Currently, I'm commenting things out and putting in return statements to change/compile/ and run the EBOOT under the PSE emulator. Is there a way to run a debugger on the EBOOT file?

Or can someone tell me if the psp file functions work under the emualtor? I've been having trouble getting the Quake prog. to log debug info to a file. Every time I try to open /write to a file, it crashes the emulator. I haven't tried it yet on the PSP.

Thanks in advance.

-PacManFan
Back to top
View user's profile Send private message Send e-mail
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Mon Jun 27, 2005 3:16 am    Post subject: PSPQuake status update(if anyone is interested) Reply with quote

I've got Quake compiling, and linking for the PSP. I've gone as far as I can go with the PSP emualtor, because it doesn't seem to support va args, or seem to support any File I/O functions. I'm running my Quake test application on my PSP now, and I've successfully got it loading up a .pak file. My next step is to implement the video functions, input, and sound. Network support is on hold right now until someone figures out the PSP net function (maybe it'll be me?!?)

My question is: Does anyone know a good way to quickly go through the change/compile/upload/test cycle on the PSP? It still takes me about 1-2 minutes to make a change, and then get it on the PSP to test. At least now I've got a debug log and I'm not going blind.

-PMF
Back to top
View user's profile Send private message Send e-mail
Hippo



Joined: 25 Jun 2005
Posts: 19

PostPosted: Tue Jun 28, 2005 6:22 am    Post subject: Reply with quote

You could try using PSPE, although it's certainly debatable how well it functions...
Back to top
View user's profile Send private message
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Tue Jun 28, 2005 8:35 am    Post subject: Reply with quote

This is how I do it:
Keep the KXploit app in the background so it remembers the path. Keep the PSP connected.

After a test run, arrow over to USB mode. Then start coding. When done type make, press Generate files in kxploit (will automatically copy to psp), press circle and arrow over to Game/Memstick/yourtestapp on the PSP and press X. I suppose the kxploit step could be automated better by adding a step to the makefile, that's next on my TODO.
Back to top
View user's profile Send private message
Hippo



Joined: 25 Jun 2005
Posts: 19

PostPosted: Tue Jun 28, 2005 12:02 pm    Post subject: Reply with quote

After playing around with KXploit.exe, which's found in the folder you installed KXploit Tool in, I've magically discovered that the argument list is as follows: kxploit.exe <PBP to patch> <folder to create on PSP> <output location> <output log> <path to look for arial.ttf?>

For example: kxploit.exe C:\hellopsp\EBOOT.PBP HELLOPSP F:\PSP\GAME

(AFAIK, output log and font path aren't required.)

EDIT: Made a slight mistake...
Back to top
View user's profile Send private message
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Tue Jun 28, 2005 11:23 pm    Post subject: Debugging Quake Reply with quote

Hippo, ector,

Thanks for the tips,
I really wish that PSPE would work. Every time it tries to execute teh code compiled for a va_args (va_start - va_end) function, it crashes. That means it crashes on printf, sprintf, Log(), etc... just about everywhere. The code works on the PSP, I guess the compiler is generating an instruction that the PSPE can't interpret.

Quake is coming along nice. Last night, I got more garbage on the screen. Now I need to keep working out the color map and some of the blitting routines.

-PMF
Back to top
View user's profile Send private message Send e-mail
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Tue Jun 28, 2005 11:34 pm    Post subject: Reply with quote

good luck - can't wait to see the fruits of your labour! :D
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Wed Jun 29, 2005 11:15 pm    Post subject: Not long now. Reply with quote

Alright!
I just played my first very crippled game of PSPQuake last night!

Current status:

Controls:
Controls are mapped to the buttons, I may change things around to improve playability.

Video:
The palette needs to be mapped to the correct colors and converted to 16bpp

Audio:
Not implemented.

Network/ Multiplayer:
Not until we can figure out the Network libraries

Today, I'm going to add the audio, work on input mapping, and palette. I also need to go back and look at some video routines I commented out because there were causing crashes.

It's not going to be long now.
I'd just like to say that the only way that this was possible is because I hacked the gcc 4.0.0 toolchain script to remove the SEB/SEH instructions so I could get this running in the PSPE emulator.

-PMF out.
Back to top
View user's profile Send private message Send e-mail
sq377



Joined: 11 Apr 2005
Posts: 87

PostPosted: Wed Jun 29, 2005 11:20 pm    Post subject: Reply with quote

heh, networking is almost figured out, can't wait to see this. Whats your crippled version of quake playing at, how close to full speed?
Back to top
View user's profile Send private message AIM Address MSN Messenger
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Jun 30, 2005 4:56 am    Post subject: Re: Not long now. Reply with quote

PacManFan wrote:
I'd just like to say that the only way that this was possible is because I hacked the gcc 4.0.0 toolchain script to remove the SEB/SEH instructions so I could get this running in the PSPE emulator.


As I indicated yesterday, a simple -march=6000 on the GCC command line would've removed the Allegrex-specific instructions.
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu Jun 30, 2005 5:10 am    Post subject: Re: Not long now. Reply with quote

PacManFan wrote:
Alright!
I just played my first very crippled game of PSPQuake last night!

Current status:

Controls:
Controls are mapped to the buttons, I may change things around to improve playability.

Video:
The palette needs to be mapped to the correct colors and converted to 16bpp

Audio:
Not implemented.

Network/ Multiplayer:
Not until we can figure out the Network libraries

Today, I'm going to add the audio, work on input mapping, and palette. I also need to go back and look at some video routines I commented out because there were causing crashes.

It's not going to be long now.
I'd just like to say that the only way that this was possible is because I hacked the gcc 4.0.0 toolchain script to remove the SEB/SEH instructions so I could get this running in the PSPE emulator.

-PMF out.


Any chance you have tried out on a real psp? Have to be careful with what PSPE allows vs the real thing.
Back to top
View user's profile Send private message
zigzag



Joined: 26 Jan 2005
Posts: 129

PostPosted: Thu Jun 30, 2005 5:28 am    Post subject: Reply with quote

Can't wait! What fps are you getting? I guess it should be possible to get full fps?

Is it possible to use the PSP's 3D hardware for it somehow in the future?
Back to top
View user's profile Send private message
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Thu Jun 30, 2005 6:25 am    Post subject: Moving closer Reply with quote

I've got PSPQuake running at about 8-9 FPS under the PSPE, I'm at work right now ;) , so I don't have my PSP with me. I briefly ran it last night, but it crashes after about 8 seconds on the loading screen. I've got to debug that when I get home.

Status:

Video:
Colors are all correct now, 8-9 FPS in PSPE emulator, not sure what this translates to on a real PSP. I'm going to put in an option to bump up the processor speed to 333 just in case. I rewrote some of the blit routines to copy from the quake frame buffer to the PSP screen with 8->16bpp color mapping, this could still be tweaked / rewritten in assembler.

Controls:
Still tweaking for playablilty.

Audio:
I put in the low level stuff just a little while ago, no longer crashes, still no sound, maybe later tonight or tommorrow.

Network:
Monitoring the Network "Some sceNet / sceHttpInit usage questions" thread intently.


I'll try to post a screenshot soon.
-PMF
Back to top
View user's profile Send private message Send e-mail
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Thu Jun 30, 2005 6:33 am    Post subject: A screen shot Reply with quote

Here's a screen capture from the PSPE running PSPQuake.




I'm still working on figuring out why some the text isn't drawing correctly, and why the console background image causes it to crash.

-PMF
Back to top
View user's profile Send private message Send e-mail
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu Jun 30, 2005 8:56 am    Post subject: Reply with quote

nice, I hope it works on real hardware.

You deal with missallignment already? (something that original code has a serious issue with).

Also look into maybe having it directly render to the psp framebufffer in 16bit insted of redering to another buffer and having to translate it.
Back to top
View user's profile Send private message
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Thu Jun 30, 2005 10:48 am    Post subject: Beta test version ready Reply with quote

OK, Here's the deal,

I want to get this release ready ASAP for everyone. The first couple of people to email me get a BETA EBOOT.PBP and the pak file.

A couple of restrictions though:

1)Don't distribute it to everyone else quite yet, I don't want to get slashdotted when this thing is half working.

2) I need feedback for playability / buttons mappings, make some suggestions as to the layout and function.

3) Play test, this is the fun part. report back any crashes /glitches/ graphical errors, etc...


Here's the current status:

Video:
Looks good, runs at about 20 fps (estimate)

Audio:
I'm working on it tonight, hopefully I'll have it by tomorrow.

Controls:
I need some good suggestions as to what to map where.

Networking:
As soon as someone has a Berkley compatible socket API.


Thanks for the help everyone.


-PMF out...
_________________
"I'm a little source code, short and stout
Here is my input, here is my out."

Author of PSPQuake and PSPSOne.
Back to top
View user's profile Send private message Send e-mail
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Thu Jun 30, 2005 11:07 am    Post subject: Reply with quote

With some luck you may be able to use hardware in the near future to upconvert from 8-bit to 16/32-bit color ;)
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu Jun 30, 2005 3:58 pm    Post subject: Reply with quote

email sent. :D
Back to top
View user's profile Send private message
F9zDark



Joined: 02 Apr 2005
Posts: 127

PostPosted: Thu Jun 30, 2005 4:43 pm    Post subject: Reply with quote

Email sent. Hope to hear from you. :)
Back to top
View user's profile Send private message AIM Address
Cogboy



Joined: 19 Jan 2005
Posts: 45

PostPosted: Thu Jun 30, 2005 5:19 pm    Post subject: Reply with quote

mail sent. :)
_________________
"the sony PSP was built by god, to determine who on earth had the best skills to defeat the armies of satan" - Saint Peter.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
cyberheater



Joined: 26 Jun 2005
Posts: 4

PostPosted: Thu Jun 30, 2005 5:37 pm    Post subject: Reply with quote

email sent :)
Back to top
View user's profile Send private message
Hippo



Joined: 25 Jun 2005
Posts: 19

PostPosted: Thu Jun 30, 2005 5:39 pm    Post subject: Reply with quote

Sent!
Back to top
View user's profile Send private message
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Thu Jun 30, 2005 7:43 pm    Post subject: Reply with quote

sent... (aswell)
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
inomine



Joined: 05 May 2005
Posts: 53

PostPosted: Thu Jun 30, 2005 8:53 pm    Post subject: Reply with quote

Sent this morning. ;)

I guess a lot of people are going to be interested, it might be easier to just go ahead and post it, statiting that it cannot be redistributed or advertised, that would stop the lot of PSP Hacker getting at it for a while.
Back to top
View user's profile Send private message
goblindojo



Joined: 22 Jun 2005
Posts: 6

PostPosted: Thu Jun 30, 2005 9:36 pm    Post subject: Reply with quote

You can send it to a small amount of testers and ask them nicely not to redistribute it, but you can't prevent them since Quake is licensed under the GPL. So PSP-hacker et al could distribute it to all and sundry once they get ahold of a copy.

So PacManFan's original plan is probably best suited for his purpose of having a few people beta test it.
Back to top
View user's profile Send private message
zith



Joined: 21 Apr 2005
Posts: 4

PostPosted: Thu Jun 30, 2005 11:27 pm    Post subject: Reply with quote

Maybe this keymapping would work for a game like quake:

Control view with analog "stick".
Walk forward, backwards and strafe with the buttons on the right (x,o etc).
Select weapon and such with the cross.
Shoot with R and jump with L or vice versa.

This could take a while getting used to, but one would want to be able to look in any direction and strafe etc when playing quake =)
Back to top
View user's profile Send private message
PacManFan



Joined: 25 Jun 2005
Posts: 66

PostPosted: Thu Jun 30, 2005 11:29 pm    Post subject: Thanks Reply with quote

Thanks to everyone who responded,

I sent out a beta to the first five who emailed me, and I've already gotten back quite a few usefull comments.

1) The game crashes randomly (I know why now, it's a floating point rounding problem)

2) Controls aren't really mapped to any good inputs (I' m still working on this, I've got a fairly playable setup right now)

3) Framerate could still be tweaked a little.

4) Audio isn't implemented

5) Save and Load don't work.

Most of these things I can fix today.

BTW, I spoke with Malum, the Forum Admin over at PSPHacker.com, and I gave him a copy to preview. He's prepping a news story now, and promised not to distribute anything till I give the go-ahead.

I've got a busy day today fixing bugs
I'll post an update l8r

-PMF out
_________________
"I'm a little source code, short and stout
Here is my input, here is my out."

Author of PSPQuake and PSPSOne.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group